﻿using System;
using System.ComponentModel;

namespace InfiniTec.Threading
{
	public class AsyncCompletedEventArgs<T>: AsyncCompletedEventArgs
	{
		private readonly T _Result;

		public T Result { get { return _Result; } }

		public AsyncCompletedEventArgs(Exception error) : this(error, null) {
		}
		public AsyncCompletedEventArgs(Exception error, object userState) : base(error, false, userState) { }

		public AsyncCompletedEventArgs(T result)
			: this(result, null)
		{
		}

		public AsyncCompletedEventArgs(T result, Exception ex)
			: base(ex, false, null)
		{
			_Result = result;
		}

		public AsyncCompletedEventArgs(T result, object userstate)
			: base(null, false, userstate)
		{
			_Result = result;
		}
	}
}